package db8;

public class Retangle extends Shape{
    int width;
    int height;
    public Retangle(){

    }
    public Retangle(String color,int width,int height){
        super(color);
        this.width=width;
        this.height=height;
    }
    @Override
    public int getArea(){

        return  width*height;
    }
    public int getPer(){
        return (width+height)*2;
    }
//    public String getColor(){
//        return color;
//    }
    public void showAll(){
        System.out.println("长："+height+"宽："+width+"面积；"+getArea()+" 周长："+getPer()+" 颜色："+getColor());
    }
}
